<html>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

<f:view>
	<head>
	<title><h:outputText value="#{msgs.titleSearch}" /></title>
	</head>
	<body>
	<h1><h:outputText value="#{msgs.titleSearch}" /></h1>
	<h:form>
		<h:outputFormat value="#{msgs.yourQuery}" escape="false">
			<f:param value="#{searchQueryBean.userQuery}" />
		</h:outputFormat>

		<h:commandLink action="index" value="#{msgs.linkReturnIndex}" />
	</h:form>
        <h:dataTable rendered="#{searchQueryBean.hasResults}"
                     value="#{searchQueryBean.results}" var="result">
            <h:column>
                <f:facet name="header"><h:outputText value="#{msgs.labelSize}"/></f:facet>
                <h:outputText value="#{result.size}" />
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="#{msgs.labelDate}"/></f:facet>
                <h:outputText value="#{result.date}">
                    <f:convertDateTime dateStyle="short" type="both" />
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="#{msgs.labelFlags}"/></f:facet>
                <h:outputText value="#{result.flags}" />
            </h:column>
            <h:column>
                <f:facet name="header"><h:outputText value="#{msgs.labelFilename}"/></f:facet>
                <h:outputText value="#{result.filename}" />
            </h:column>

        </h:dataTable>
	</body>
</f:view>
</html>